/*
 * @Description: table表格二
 * @Author: ZhangHan
 * @Date: 2025-04-23 09:51:33
 * @LastEditTime: 2025-05-14 10:51:42
 * @LastEditors: ZhangHan
 */
import { useEffect, useState } from "react";
import { cascaderOptions } from "@/mock/country";
import type { CascaderProps } from "antd";
import { Cascader } from "antd";
import { ProSelect } from "@/components/ProComponents/index";
import { getSelectData } from "@/utils/common";
import { HEALTHRISKASSESSMENT_RISK } from "@/concacts/valueEnum";

function MyTableTwo() {
  const [options, setOptions] =
    useState<CascaderProps["options"]>(cascaderOptions);
  useEffect(() => {
    console.log(cascaderOptions, "级联数据");
    setOptions(cascaderOptions);
  }, []);

  const onChange = (
    value: string[],
    selectedOptions: CascaderProps["options"]
  ) => {
    console.log(value, selectedOptions);
  };

  const selectChange = (value: any, options: any) => {
    console.log(value, options, "---");
  };
  return (
    <>
      <div className="mb-2">
        <Cascader
          options={options}
          onChange={onChange}
          placeholder="请选择城市"
        />
      </div>
      <div>
        <ProSelect
          mode="multiple"
          style={{ width: "10%" }}
          options={getSelectData(HEALTHRISKASSESSMENT_RISK)}
          placeholder="请选择风险等级"
          showSearch={true}
          callback={selectChange}
        />
      </div>
    </>
  );
}

export default MyTableTwo;
